﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse;

namespace Miao.Stand
{
    public class Verb_StandUseAbility : Verb_LaunchProjectile
    {


        public Action OnCastEnd;

        //一直攻击的原因是他调用的Verb_Static，一直执行所以不能调用

        public void ShotEnd()
        {
            Messages.Message("执行完毕", MessageTypeDefOf.NegativeEvent);
        }
        //public bool TryStartCastOn(LocalTargetInfo castTarg, LocalTargetInfo destTarg, bool surpriseAttack = false, bool canHitNonTargetPawns = true, bool preventFriendlyFire = false)
        //{
        //    bool start = base.TryStartCastOn(castTarg, destTarg, surpriseAttack, canHitNonTargetPawns, preventFriendlyFire);
        //    return start;
        //}
        protected override bool TryCastShot()
        {
            bool s = base.TryCastShot();
            if (burstShotsLeft == 1)//这样在执行好射击后会自动终止射击任务
            {
                (caster as Pawn).jobs.StopAll();
            }
            return s;
        }
    }
}
